• Marcin Trofiniak 9
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies

So i am creating my first unmanaged package with namespace. I created the package with no problem but when i tried to create package version i get this error:

Sie können kein nicht gesperrtes Paket ohne Namespace in einer Organisation mit Namespace installieren

I used this commend :

sfdx force:package:version:create -k "password" -w 40 -p "mypackageID"

and here is package definiton file:

{ "sourceApiVersion": "45.0", "sfdcLoginUrl": "https://login.salesforce.com", "namespace": "amsHRR", "packageDirectories": [ { "definitionFile": "config/project-scratch-def.json", "package": "HRProcessesSupportApp", "default": true, "versionNumber": "0.0.0.NEXT", "dependencies": [ { "package": "Propel", "subscriberPackageVersionId": "packageID" }, { "package": "ZeroStateAMSApp", "subscriberPackageVersionId": "packageID" } ], "versionName": "Version 0.0", "path": "force-app" } ], "packageAliases": { "Propel": "04t1S000000XzOQQA0", "ZeroStareAMSApp": "packageID", "ZeroStareAMSApp@0.0.0-1": "packageID", "HRProcessesSupportApp": "packageID" } }

 

Hi I am using SFDX and scratch org and new feature of package development model in my company.

 

so my problem is that when i create new package version of what i build ( i added field on object that is part of other package ) i get error:

=== Errors
(1) Design_Time_Sheet__c.Test1__c: Entity 'Design_Time_Sheet__c' not found.
(2) PDLM__Project__c.test2__c: Entity 'PDLM__Project__c' not found.

But these two elements ( objects ) are aprt of packages added to sfdx-project.json which look like this:

{
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "45.0",
"packageDirectories": [
{
"definitionFile": "config/ossurCommonCore.json",
"package": "amsZeroStateTest1",
"default": true,
"versionNumber": "0.0.0.NEXT",
"versionName": "Version 0.0",
"path": "force-app",
"dependencies": [
{
"package": "Propel",
"subscriberPackageVersionId":"04t1S000000XzOQQA0"
},
{
"package": "amsZeroState",
"subscriberPackageVersionId":"04t1r000001aWRr"
}
]
},
{
"path": "force-app",
"package": "amsZeroStateTest1",
"versionName": "ver 0.1",
"versionNumber": "0.1.0.NEXT",
"default": false
}
],
"packageAliases": {
"Propel": "04t1S000000XzOQQA0",
"amsZeroState": "04t1r000001aWRr",
"amsZeroStateTest1": "0Ho1r000000008ZCAQ"
}
}

 

Why is it not visiable? and i get the error? Is there something more i should do to be able to create the package?

 

The problem i have is with vf page. What i need to do is get two values which are Date type from user and after he click button based on those values gatther data from SF and show them in correct way.

 

I am at very begining of the road and I am blocked with that my variables do not get updated after button click. So i can't really sue them in my controller and what is more i can rerender content of page with other variable cause it is not changing for page as well...

 

Code page:
 

<apex:page controller="pageGenerator" docType="html-5.0">
    <apex:form>
         <script>
            function sideSetter()
            {
                dataSetter();
                document.getElementById('{!$Component.mainform.mainBlock.mainDisplay}').innerHTML = '{!mainTableArea}';
            }
        </script>
        <apex:actionFunction name="dataSetter" action="{!dataSetter}" rerender="mainform.mainDisplay"/>
    </apex:form>
    <apex:form id="mainform">
        <apex:pageBlock title="dynamictest" id="mainBlock">
            <apex:pageBlockSection title="Filters" id="mainWork" columns="1">
                <apex:input title="Start date" label="Start date" type='date' value="{!startDate}"/>
                <apex:input title="End date" label="End date" type="date" value="{!endDate}"/>
                <apex:commandButton value="Generate" onclick="sideSetter();" rerender="mainform.mainDisplay"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="renderedpart" id="mainDisplay">
                Nothing yet....
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>    
</apex:page>

Code controller:

public class pageGenerator
{
    
    public String mainTableArea {get;set;}
    public Date startDate {get;set;}
    public Date endDate {get;set;}
    
    
    private void setMainTableArea( String theString )
    {
        this.mainTableArea = theString;
    }
    
    public pageGenerator()
    {
        mainTableArea = 'nicnicnic';
        startDate = Date.today();
        endDate = Date.today().addMonths(1);
    }
    
    public PageReference dataSetter()
    {
        setMainTableArea( String.valueOf(startDate) + ' ' + String.valueOf(endDate) );
        system.debug( MainTableArea + ' ' + String.valueOf(startDate) + ' ' + String.valueOf(endDate) );
        
        return null;
    }
    
}

Can any one tell me what i do wrong. After clicking the button some times endDate get updated but never startDate and the mainTableArea varaible never get's updated when the dataSetter methods is being triggered.

 

 

By the way if you think this is bad way of doing what i want and i should use other technology let me know ;) we use only classic.

Hi I am using SFDX and scratch org and new feature of package development model in my company.

 

so my problem is that when i create new package version of what i build ( i added field on object that is part of other package ) i get error:

=== Errors
(1) Design_Time_Sheet__c.Test1__c: Entity 'Design_Time_Sheet__c' not found.
(2) PDLM__Project__c.test2__c: Entity 'PDLM__Project__c' not found.

But these two elements ( objects ) are aprt of packages added to sfdx-project.json which look like this:

{
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "45.0",
"packageDirectories": [
{
"definitionFile": "config/ossurCommonCore.json",
"package": "amsZeroStateTest1",
"default": true,
"versionNumber": "0.0.0.NEXT",
"versionName": "Version 0.0",
"path": "force-app",
"dependencies": [
{
"package": "Propel",
"subscriberPackageVersionId":"04t1S000000XzOQQA0"
},
{
"package": "amsZeroState",
"subscriberPackageVersionId":"04t1r000001aWRr"
}
]
},
{
"path": "force-app",
"package": "amsZeroStateTest1",
"versionName": "ver 0.1",
"versionNumber": "0.1.0.NEXT",
"default": false
}
],
"packageAliases": {
"Propel": "04t1S000000XzOQQA0",
"amsZeroState": "04t1r000001aWRr",
"amsZeroStateTest1": "0Ho1r000000008ZCAQ"
}
}

 

Why is it not visiable? and i get the error? Is there something more i should do to be able to create the package?

 

The problem i have is with vf page. What i need to do is get two values which are Date type from user and after he click button based on those values gatther data from SF and show them in correct way.

 

I am at very begining of the road and I am blocked with that my variables do not get updated after button click. So i can't really sue them in my controller and what is more i can rerender content of page with other variable cause it is not changing for page as well...

 

Code page:
 

<apex:page controller="pageGenerator" docType="html-5.0">
    <apex:form>
         <script>
            function sideSetter()
            {
                dataSetter();
                document.getElementById('{!$Component.mainform.mainBlock.mainDisplay}').innerHTML = '{!mainTableArea}';
            }
        </script>
        <apex:actionFunction name="dataSetter" action="{!dataSetter}" rerender="mainform.mainDisplay"/>
    </apex:form>
    <apex:form id="mainform">
        <apex:pageBlock title="dynamictest" id="mainBlock">
            <apex:pageBlockSection title="Filters" id="mainWork" columns="1">
                <apex:input title="Start date" label="Start date" type='date' value="{!startDate}"/>
                <apex:input title="End date" label="End date" type="date" value="{!endDate}"/>
                <apex:commandButton value="Generate" onclick="sideSetter();" rerender="mainform.mainDisplay"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="renderedpart" id="mainDisplay">
                Nothing yet....
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>    
</apex:page>

Code controller:

public class pageGenerator
{
    
    public String mainTableArea {get;set;}
    public Date startDate {get;set;}
    public Date endDate {get;set;}
    
    
    private void setMainTableArea( String theString )
    {
        this.mainTableArea = theString;
    }
    
    public pageGenerator()
    {
        mainTableArea = 'nicnicnic';
        startDate = Date.today();
        endDate = Date.today().addMonths(1);
    }
    
    public PageReference dataSetter()
    {
        setMainTableArea( String.valueOf(startDate) + ' ' + String.valueOf(endDate) );
        system.debug( MainTableArea + ' ' + String.valueOf(startDate) + ' ' + String.valueOf(endDate) );
        
        return null;
    }
    
}

Can any one tell me what i do wrong. After clicking the button some times endDate get updated but never startDate and the mainTableArea varaible never get's updated when the dataSetter methods is being triggered.

 

 

By the way if you think this is bad way of doing what i want and i should use other technology let me know ;) we use only classic.

Hi, i need help to write test class for following trigger.
trigger UpdateProblemTaskOwner on SC_Problem_Task__c  (after insert, after update, after delete,before update) {
    if (Trigger.isBefore && Trigger.isUpdate)
    {
        for(SC_Problem_Task__c  pt : Trigger.new)
            {
                List<Group> qid = [select Id from Group where Name = : pt.Assignment_Group__c and Type = 'Queue'];
                for(Group g : qid)
                {
                    pt.OwnerId = g.id;
                    System.debug('updated');
                }
        }
    }
}

Thanks in advance.