web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Prepopulate Contact an...
Power Pages
Unanswered

Prepopulate Contact and Account when Creating a Case.

(1) ShareShare
ReportReport
Posted on by 39
Hello all:
 
I am struggling to figure out how to pre-populate the Account and Contact when a logged on user creates a new case. It also occurred to me this seems like a security issue, if you look at the attached screens, I am logged in with a Contact Account, however in the Case Creation form, I can choose any customer and/or Contact to create a case on behalf of, this seems like a big security hole to me? IDK why it isn't a simple, OOTB feature that for a logged on Contact, when creating a case, the Account and Contact are read-only and automatically set to the logged on user? 

Can anyone help?
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi
     
    I didn't look at the pictures yet, but Contacts respectively cannot log in. They are just "data in a table".
     
    The issue is not that they are a contact, its what permissions were given to them as Logged in Users.
     
    These things are different. So its not a security risk in the sense of the platform, its how you implemented it and whom is logged in and what permissions they are given :-)
  • Suggested answer
    Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at
    The portal user can only see what you give them access to see - it appears you have created some Table Permissions with Global Read on Contact and Account, this is generally not recommended as it can create a security/privacy issue (try to limit Global to things like configuration/reference data e.g. like of categories).
     
    One of the issues will also be that Customer is a field type that can accept both a Contact and Account record (and not all Contacts will have an Account).  Several different approaches:
     
     
     
  • jstraumann Profile Picture
    39 on at
    @Fubar thanks for the detailed input! Unfortunately I had tried all this already with no joy. I tried to upload Pics and the Custom JS I did, but the site blocked it, so I put the files in a Zip on my Onedrive:   CaseCreateMetaData.zip

    Note the Case Create form is not in it's own web page, it appears as a pop up.
  • Suggested answer
    GWham Profile Picture
    58 Moderator on at
    On your form, go into it and add metadata.
     
    Select the attribute/field in the meta data and add one for contact
     
    Under pre-populate section, select the contact and from the dropdown logged in user.
     
    That will populate that lookup. You can also set a value on save of the form.
     
    Alternatively, set it with js on load if you wish .. something like...
    function populateLookup(fieldSchemaName, guid, name, tableSchemaName){
        $("#"+fieldSchemaName+"_name").val(name);
        $("#"+fieldSchemaName).val(guid);
        $("#"+fieldSchemaName+"_entityname").val(tableSchemaName);
    });
    
    populateLookup('contact', {{user.id}}, {{user.fullname}}, 'contact)
    
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard