Skip to main content

Notifications

Power Platform Community / Forums / Power Apps Portals / Prepopulate Contact an...
Power Apps Portals
Suggested answer

Prepopulate Contact and Account when Creating a Case.

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:
  • Suggested answer
    GWham Profile Picture
    GWham 39 on at
    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 at
    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,375 on at
    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 23,361 on at
    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 :-)

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,745

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard