Skip to main content

Notifications

Power Pages - Power Apps Portals
Suggested answer

Prepopulate Contact and Account when Creating a Case.

Like (1) ShareShare
ReportReport
Posted on 7 Sep 2024 12:21:43 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:
  • Suggested answer
    GWham Profile Picture
    GWham 54 on 09 Sep 2024 at 14:55:57
    Prepopulate Contact and Account when Creating a Case.
    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)
    
     
  • jstraumann Profile Picture
    jstraumann 39 on 09 Sep 2024 at 12:55:09
    Prepopulate Contact and Account when Creating a Case.
    @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
    Fubar Profile Picture
    Fubar 7,643 on 08 Sep 2024 at 22:10:34
    Prepopulate Contact and Account when Creating a Case.
    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:
     
     
     
  • Suggested answer
    FLMike Profile Picture
    FLMike 27,286 on 07 Sep 2024 at 23:05:25
    Prepopulate Contact and Account when Creating a Case.
    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 :-)

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,769

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,466

Leaderboard
Loading started