• Sabina
  • NEWBIE
  • 40 Points
  • Member since 2015
  • Salesforce.com Developer
  • Deloitte

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 10
    Questions
  • 23
    Replies
Hello,

I am trying to use the lightning/uiRecordApi module for an LWC component that is also used in Communities. Everything works fine when internal users view the community; but if I log in as a community user, getRecordUi and getRecord adapters return undefined. The community user has a permission set with API Enabled = true.

 I know these adapters use User Interface API resources and, according to the documentation (https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_get_started_intro.htm), community users should be able to access the API. 

Could anyone help me understand why this is not working, please?

Thanks,
Sabina
Hello,

I want to use the same icon both as LWC icon (in the .svg bundle file) and as header icon in the .html file for multiple components. Is there a way to achieve this without duplicating the code?

I can use a static resource for the header icons of multiple componentsm but can't access it in the .svg files. 

Also, can I somehow access the local .svg file into the .html file of the same bundle?

Thank you!
Sabina
  • April 21, 2020
  • Like
  • 0
Hello,

I created a scratch orgs without problems and now I am trying to push the source from the local branch.
I am getting 68 errors of this type:
An object 'Account.ParentId' of type CustomField was named in package.xml, but was not found in zipped directory
All the mentioned fields are in the sfdx project source under main/default/objects/Account/fields and the scratch org API version matches the project one. 
Could anyone help me understand what I'm doing wrong, please?

Many thanks!
Sabina
 
Hello,

I am trying to figure out why a particular external user has access to a case and its related account. The user and its contact are not related in any way to these. But if I check the sharing details of both the case and the account, there are sharing records for this user.

For the account, the sharing reason is 'Associated record owner or sharing'. If I click on this, I see a list of cases with empty case teams. However, for each of these cases, the user is showing up in the sharing detail page with the reason 'Team'.

Does anyone have any idea what the 'Team' reason might mean if the case has no case team? Any help would be much appreciated.
Many thanks!
 
  • April 06, 2018
  • Like
  • 0
Hello,

Does anyone know what are the default rules for assigning an owner to a contact? I'm logged in as a community user and in the background I'm creating a contact through an Apex controller. The code creates the contact but never assigns the user. There is no workflow rule / process builder set for contacts. The newly created contact is created by my community user, but the owner is set to a random admin in my org. This "default owner" is different in different sandboxes of the same org. In one of them it tried to assign an inactive admin and threw an error.

Thanks
Hello,

I am trying to create dependent select lists: when the first one is changed, the second one updates its options and so on.
But for the life of me I cannot figure out how to get the value of the first select list to not return null.

My VF page:
<apex:page controller="TryCtrl">
    <apex:form>
        <apex:pageBlock title="Filters">
            <apex:pageMessages />
            <apex:pageBlockSection>
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Product Family" />
                    <apex:actionRegion>
                        <apex:selectList value="{!family}" size="1" id="ffamily">
                            <apex:selectOptions value="{!familyList}" />
                            <apex:actionSupport event="onchange" rerender="fproduct" />
                        </apex:selectList>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem> 
                
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Product"/>
                    <apex:actionRegion >
                        <apex:selectList value="{!product}" id="fproduct" size="1" >
                            <apex:selectOptions value="{!productList}"/>
                        </apex:selectList>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem> 
                    
            </apex:pageBlockSection>
		</apex:pageBlock>
    </apex:form>
</apex:page>

My controller:
public class TryCtrl {
	private final Id accId = '001g000000cnDTb';
    private List<Custom__c> objects;
    public String family {get;set;}
    public String product {get;set;}
    
    public TryCtrl() {
        this.objects = [select ...];
    }
    
    public Set<SelectOption> getFamilyList() {
        Set<SelectOption> options = new Set<SelectOption>{new SelectOption('', '--All--')};
        for(Custom__c o : this.objects) {
            options.add(new SelectOption(o.Product_Family__c, o.Product_Family__c));
        }
        return options;
    }
    
    public Set<SelectOption> getProductList() {
        Set<SelectOption> options = new Set<SelectOption>{new SelectOption('', '--All--')};
        for(Custom__c o : this.objects) {
            if(String.isBlank(family) || o.Product_Name__c == family)
            	options.add(new SelectOption(o.Product_Name__c, o.Product_Name__c));
        }
        return options;
    }
}

When the page loads, the two are populated correctly. Changing the first select list is rerending the second one, but the 'family' variable is still set to null, so the products list is the same as before. I tried removing actionRegion, but didn't help. Can anyone please help? Thanks.
  • April 26, 2016
  • Like
  • 0
Hello,

I am trying to display an angularjs table and add some Visualforce + Apex filters to it. 
I am creating the JSON string in the Apex controller with 
JSONGenerator tableJson = JSON.createGenerator(true);
tableJson.writeStartArray();
tableJson.writeStartObject();
tableJson.writeStringField('name', 'value');
// etc
tableJson.writeEndObject();
tableJson.writeEndArray();

then format it for Visualforce to retrieve it:
public String getTableJson() {
        return tableJson.getAsString();
    }

In Visualforce I can use angularjs ui-grid using this tableJson without problems
<div ng-app="report">
		<div ng-controller="MainCtrl">
			<div id="grid1" ui-grid-grouping="true" ui-grid="gridOptions" class="grid">
			</div>
		</div>
	</div>

	<script type="text/javascript">
		var report = angular.module('report', ['ngTouch', 'ui.grid', 'ui.grid.grouping']);
		
		angular.module('report').factory('cellStyle', function(uiGridConstants, $http){
		  // cfg and $http together at last
		});

		report.controller('MainCtrl', ['$scope', 'uiGridGroupingConstants', function ($scope, uiGridGroupingConstants) {
			$scope.gridOptions = {
				data: {!tableJson},
				onRegisterApi: function(gridApi) {
					$scope.gridApi = gridApi;
				}
			}
		}]);
		
	</script>

Everything is displaying perfectly.
However, if I add <apex:form> to the page (for the filters), I get this error:
System.JSONGenerator is not serializable. 

All I did was to add apex:form to the page, no content inside the form yet.
<apex:form></apex:form>
<div ng-app="report"><!-- content here --></div>
<script><!-- content here --></script>

and it stopped working. Does anyone have an idea why?

Many thanks!
  • April 21, 2016
  • Like
  • 0
Hello,

I have a picklist and its values have been translated to different languages. I set up a Visualforce email template with custom labels and field values to sent to contacts based on their language, using 
<messaging:emailTemplate subject="{!$Label.Email_Title}" recipientType="Contact" language="{!recipient.Language__c}">
All the custom labels are translated fine. The picklist value in the <messaging:htmlEmailBody> part of the email also displays in the correct language, using this:
<apex:outputField value="{!recipient.Industry__c}"/>

However, if I try to use apex:outputField in the <messaging:plainTextEmailBody> part of the email, it won't save because of this error:
Save error: <messaging:plainTextEmailBody> cannot contain <apex:outputField>. 
Using apex:outputText doesn't translate the value. 
Does anyone know how to get the translated value of a picklist in the plain text part of the email?

Thanks

 
  • March 10, 2016
  • Like
  • 0
I cannot complete the "Create custom objects and custom fields" Challenge. I am getting this error message: 
Challenge Not yet complete... here's what's wrong: 
All the expected custom fields for the Trail__c object could not be found.

Although I am pretty sure I got the right:
User-added image
What am I missing?
  • December 09, 2015
  • Like
  • 0
Hello,

I changed the display format of the Line Item Number (auto number) field in Contract Line Items to CL-{00000}. For some reason, the new contract line items still use the old format 1, 2, 3, etc. Does anyone know why? Am I missing something?

 User-added imageUser-added image

Thank you
  • October 07, 2015
  • Like
  • 0
Hello,

I created a scratch orgs without problems and now I am trying to push the source from the local branch.
I am getting 68 errors of this type:
An object 'Account.ParentId' of type CustomField was named in package.xml, but was not found in zipped directory
All the mentioned fields are in the sfdx project source under main/default/objects/Account/fields and the scratch org API version matches the project one. 
Could anyone help me understand what I'm doing wrong, please?

Many thanks!
Sabina
 
Hello,

I am trying to use the lightning/uiRecordApi module for an LWC component that is also used in Communities. Everything works fine when internal users view the community; but if I log in as a community user, getRecordUi and getRecord adapters return undefined. The community user has a permission set with API Enabled = true.

 I know these adapters use User Interface API resources and, according to the documentation (https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_get_started_intro.htm), community users should be able to access the API. 

Could anyone help me understand why this is not working, please?

Thanks,
Sabina
Hello,

I want to use the same icon both as LWC icon (in the .svg bundle file) and as header icon in the .html file for multiple components. Is there a way to achieve this without duplicating the code?

I can use a static resource for the header icons of multiple componentsm but can't access it in the .svg files. 

Also, can I somehow access the local .svg file into the .html file of the same bundle?

Thank you!
Sabina
  • April 21, 2020
  • Like
  • 0
Hello,

I created a scratch orgs without problems and now I am trying to push the source from the local branch.
I am getting 68 errors of this type:
An object 'Account.ParentId' of type CustomField was named in package.xml, but was not found in zipped directory
All the mentioned fields are in the sfdx project source under main/default/objects/Account/fields and the scratch org API version matches the project one. 
Could anyone help me understand what I'm doing wrong, please?

Many thanks!
Sabina
 
Hello,

I am trying to figure out why a particular external user has access to a case and its related account. The user and its contact are not related in any way to these. But if I check the sharing details of both the case and the account, there are sharing records for this user.

For the account, the sharing reason is 'Associated record owner or sharing'. If I click on this, I see a list of cases with empty case teams. However, for each of these cases, the user is showing up in the sharing detail page with the reason 'Team'.

Does anyone have any idea what the 'Team' reason might mean if the case has no case team? Any help would be much appreciated.
Many thanks!
 
  • April 06, 2018
  • Like
  • 0
Hello,

Does anyone know what are the default rules for assigning an owner to a contact? I'm logged in as a community user and in the background I'm creating a contact through an Apex controller. The code creates the contact but never assigns the user. There is no workflow rule / process builder set for contacts. The newly created contact is created by my community user, but the owner is set to a random admin in my org. This "default owner" is different in different sandboxes of the same org. In one of them it tried to assign an inactive admin and threw an error.

Thanks
Hello,

I am trying to create dependent select lists: when the first one is changed, the second one updates its options and so on.
But for the life of me I cannot figure out how to get the value of the first select list to not return null.

My VF page:
<apex:page controller="TryCtrl">
    <apex:form>
        <apex:pageBlock title="Filters">
            <apex:pageMessages />
            <apex:pageBlockSection>
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Product Family" />
                    <apex:actionRegion>
                        <apex:selectList value="{!family}" size="1" id="ffamily">
                            <apex:selectOptions value="{!familyList}" />
                            <apex:actionSupport event="onchange" rerender="fproduct" />
                        </apex:selectList>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem> 
                
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Product"/>
                    <apex:actionRegion >
                        <apex:selectList value="{!product}" id="fproduct" size="1" >
                            <apex:selectOptions value="{!productList}"/>
                        </apex:selectList>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem> 
                    
            </apex:pageBlockSection>
		</apex:pageBlock>
    </apex:form>
</apex:page>

My controller:
public class TryCtrl {
	private final Id accId = '001g000000cnDTb';
    private List<Custom__c> objects;
    public String family {get;set;}
    public String product {get;set;}
    
    public TryCtrl() {
        this.objects = [select ...];
    }
    
    public Set<SelectOption> getFamilyList() {
        Set<SelectOption> options = new Set<SelectOption>{new SelectOption('', '--All--')};
        for(Custom__c o : this.objects) {
            options.add(new SelectOption(o.Product_Family__c, o.Product_Family__c));
        }
        return options;
    }
    
    public Set<SelectOption> getProductList() {
        Set<SelectOption> options = new Set<SelectOption>{new SelectOption('', '--All--')};
        for(Custom__c o : this.objects) {
            if(String.isBlank(family) || o.Product_Name__c == family)
            	options.add(new SelectOption(o.Product_Name__c, o.Product_Name__c));
        }
        return options;
    }
}

When the page loads, the two are populated correctly. Changing the first select list is rerending the second one, but the 'family' variable is still set to null, so the products list is the same as before. I tried removing actionRegion, but didn't help. Can anyone please help? Thanks.
  • April 26, 2016
  • Like
  • 0
Hello,

I am trying to display an angularjs table and add some Visualforce + Apex filters to it. 
I am creating the JSON string in the Apex controller with 
JSONGenerator tableJson = JSON.createGenerator(true);
tableJson.writeStartArray();
tableJson.writeStartObject();
tableJson.writeStringField('name', 'value');
// etc
tableJson.writeEndObject();
tableJson.writeEndArray();

then format it for Visualforce to retrieve it:
public String getTableJson() {
        return tableJson.getAsString();
    }

In Visualforce I can use angularjs ui-grid using this tableJson without problems
<div ng-app="report">
		<div ng-controller="MainCtrl">
			<div id="grid1" ui-grid-grouping="true" ui-grid="gridOptions" class="grid">
			</div>
		</div>
	</div>

	<script type="text/javascript">
		var report = angular.module('report', ['ngTouch', 'ui.grid', 'ui.grid.grouping']);
		
		angular.module('report').factory('cellStyle', function(uiGridConstants, $http){
		  // cfg and $http together at last
		});

		report.controller('MainCtrl', ['$scope', 'uiGridGroupingConstants', function ($scope, uiGridGroupingConstants) {
			$scope.gridOptions = {
				data: {!tableJson},
				onRegisterApi: function(gridApi) {
					$scope.gridApi = gridApi;
				}
			}
		}]);
		
	</script>

Everything is displaying perfectly.
However, if I add <apex:form> to the page (for the filters), I get this error:
System.JSONGenerator is not serializable. 

All I did was to add apex:form to the page, no content inside the form yet.
<apex:form></apex:form>
<div ng-app="report"><!-- content here --></div>
<script><!-- content here --></script>

and it stopped working. Does anyone have an idea why?

Many thanks!
  • April 21, 2016
  • Like
  • 0
SF DEV's

I am trying to retrieve the Full Name of an Opportunities Contact in a VF page. I have {!Opportunity.Opportunity_Contact__r} right now but it brings up the Contact ID instead. What am I doing wrong or what do I need to do?

Thanks,

Bryn Jones
Hello,

I have a picklist and its values have been translated to different languages. I set up a Visualforce email template with custom labels and field values to sent to contacts based on their language, using 
<messaging:emailTemplate subject="{!$Label.Email_Title}" recipientType="Contact" language="{!recipient.Language__c}">
All the custom labels are translated fine. The picklist value in the <messaging:htmlEmailBody> part of the email also displays in the correct language, using this:
<apex:outputField value="{!recipient.Industry__c}"/>

However, if I try to use apex:outputField in the <messaging:plainTextEmailBody> part of the email, it won't save because of this error:
Save error: <messaging:plainTextEmailBody> cannot contain <apex:outputField>. 
Using apex:outputText doesn't translate the value. 
Does anyone know how to get the translated value of a picklist in the plain text part of the email?

Thanks

 
  • March 10, 2016
  • Like
  • 0
Hi,

We've got a class implementing Schedulable, Database.Batchable<sObject>, Database.stateful.
The class has the needed global void execute(SchedulableContext SC), but when trying to schedule it I get:
Error: You must select an Apex class that implements the Schedulable interface
What are we missing?

Many thanks,
Yishay
I cannot complete the "Create custom objects and custom fields" Challenge. I am getting this error message: 
Challenge Not yet complete... here's what's wrong: 
All the expected custom fields for the Trail__c object could not be found.

Although I am pretty sure I got the right:
User-added image
What am I missing?
  • December 09, 2015
  • Like
  • 0
Hello,

I changed the display format of the Line Item Number (auto number) field in Contract Line Items to CL-{00000}. For some reason, the new contract line items still use the old format 1, 2, 3, etc. Does anyone know why? Am I missing something?

 User-added imageUser-added image

Thank you
  • October 07, 2015
  • Like
  • 0
Just finished all of the Trails, Modules and Projects that are available up to this point using 3 different Dev Orgs. (2/3/2016)

Keep them coming. More Trails/Modules/Projects on development would be great. (Lightining,Apex,Visual Force, Javascript, Integration and using the Developer Console)

Thanks for providing these valuable resources !